package org.example.pms.service.impl;

import org.example.pms.domain.ClinicalObservation;
import org.example.pms.mapper.ClinicalObservationMapper;
import org.example.pms.service.ClinicalObservationService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ClinicalObservationServiceImpl implements ClinicalObservationService {
    @Resource
    ClinicalObservationMapper clinicalObservationMapper;


    @Override
    public ClinicalObservation selectById(Integer id) {
        ClinicalObservation clinicalObservation = clinicalObservationMapper.selectById(id);
        return clinicalObservation;
    }

    @Override
    public List<ClinicalObservation> selectByPatientId(Integer patientId) {
        List<ClinicalObservation> clinicalObservations = clinicalObservationMapper.selectByPatientId(patientId);
        return clinicalObservations;
    }

    @Override
    public Integer insert(ClinicalObservation clinicalObservation) {
        Integer insert = clinicalObservationMapper.insert(clinicalObservation);
        return clinicalObservation.getId();
    }

    @Override
    public Integer update(ClinicalObservation clinicalObservation) {
        Integer update = clinicalObservationMapper.update(clinicalObservation);
        return update;
    }

    @Override
    public Integer delete(Integer id) {
        Integer delete = clinicalObservationMapper.delete(id);
        return delete;
    }
}
